﻿using FreeSql.DataAnnotations;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;

namespace AvoidForgetting.Entities.Dtos
{
    /// <summary>
    /// 数据库信息
    /// </summary>
    [Table(Name = "Organization")]
    public class OrgDto
    {
        /// <summary>
        /// id
        /// </summary>
        [Column(IsIdentity = true, IsPrimary = true)]
        [Key]
        public string Id { get; set; }

        /// <summary>
        /// 名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 数据库类型
        /// </summary>
        public DBType DBType { get; set; }

        /// <summary>
        /// 服务器地址
        /// </summary>
        public string ServerAddress { get; set; }

        /// <summary>
        /// 服务器端口
        /// </summary>
        public string ServerPort { get; set; }

        /// <summary>
        /// 登录名
        /// </summary>
        public string UserName { get; set; }

        /// <summary>
        /// 密码
        /// </summary>
        public string Password { get; set; }

        /// <summary>
        /// 数据库名称
        /// </summary>
        public string DataBaseName { get; set; }

        /// <summary>
        /// 连接字符串
        /// </summary>
        public string ConnectingString { get; set; }

        /// <summary>
        /// 0: 未禁用 1:禁用
        /// </summary>
        public int IsDeleted { get; set; } = 0;

        /// <summary>
        /// 1：启用、0：未启用
        /// </summary>
        public int IsStart { get; set; } = 0;
    }

    /// <summary>
    /// 支持的数据库类型
    /// </summary>
    public enum DBType
    {
        /// <summary>
        /// SqlServer
        /// </summary>
        SqlServer,
        /// <summary>
        /// Oracle
        /// </summary>
        Oracle,
        /// <summary>
        /// Mysql
        /// </summary>
        Mysql
    }
}
